Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 25, 2025

Summary

This PR fixes issue #8307 where using custom system prompts (via .roo/system-prompt-code file) breaks the read_file tool for the code-supernova model.

Problem

When users override the system prompt using a custom file, the tool descriptions were completely omitted from the prompt. This caused models like code-supernova (which require a simplified read_file format) to fail with errors like:

Roo tried to use read_file without value for required parameter 'path'. Retrying...

Solution

Modified the system prompt generation to always include tool descriptions even when using file-based custom prompts. This ensures that:

  • Models get the proper tool usage instructions
  • code-supernova receives the simplified read_file format it requires
  • Other models continue to work as expected

Changes

  • Modified src/core/prompts/system.ts to include tool descriptions with custom prompts
  • Updated tests to reflect the new behavior
  • Added specific test for code-supernova model with custom prompts

Testing

  • ✅ All existing tests pass
  • ✅ Added new test specifically for code-supernova with custom prompts
  • ✅ Verified simplified read_file format is used for code-supernova
  • ✅ Confirmed complex multi-file format is not included for code-supernova

Fixes #8307


Important

Fixes issue #8307 by ensuring tool descriptions are included in custom system prompts for code-supernova, modifying system.ts and updating tests accordingly.

  • Behavior:
    • Fixes issue I broke Roo by using Footgun mode #8307 by ensuring tool descriptions are included in custom system prompts for code-supernova.
    • Ensures code-supernova receives the simplified read_file format.
  • Implementation:
    • Modified system.ts to include tool descriptions in custom prompts.
    • Ensures tool descriptions are always included for file-based custom prompts.
  • Testing:
    • Updated custom-system-prompt.spec.ts to test inclusion of tool descriptions.
    • Added test for code-supernova model with custom prompts to verify simplified read_file format.

This description was created by Ellipsis for 1569b46. You can customize this summary. It will automatically update as commits are pushed.

…rnova

- Modified system prompt generation to always include tool descriptions even when using custom system prompt files
- This fixes the issue where code-supernova model would fail to parse read_file tool parameters when using custom prompts
- Updated tests to reflect the new behavior
- Ensures models like code-supernova that require simplified tool formats get the proper tool descriptions

Fixes #8307
@roomote roomote bot requested review from cte, jr and mrubens as code owners September 25, 2025 14:29
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 25, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Sep 25, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auditing my own code like a mirror with unit tests—nothing like arguing with yourself in JSON.

const modeConfig = getModeBySlug(mode, customModes) || modes.find((m) => m.slug === mode) || modes[0]

// Check if MCP functionality should be included
const hasMcpGroup = modeConfig.groups.some((groupEntry) => getGroupName(groupEntry) === "mcp")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: modeConfig.groups is accessed without a guard. A custom mode object may omit groups, causing a runtime error. Also applies to the earlier generatePrompt path.

Suggested change
const hasMcpGroup = modeConfig.groups.some((groupEntry) => getGroupName(groupEntry) === "mcp")
const hasMcpGroup = (modeConfig.groups || []).some((groupEntry) => getGroupName(groupEntry) === "mcp")

${getToolUseGuidelinesSection(codeIndexManager)}
${fileCustomSystemPrompt}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The custom file-based prompt is appended after the Roo Tool Use sections. Consider placing the user’s custom prompt before tool/guidelines to preserve authorial context, or clarify precedence so Roo tool sections supersede overlapping instructions.

@daniel-lxs daniel-lxs closed this Sep 25, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 25, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

I broke Roo by using Footgun mode

4 participants